{% extends '_base.html' %}

{% load static %}

{% block title %}登录{% endblock %}

{% block content %}
    <section class="dark:bg-gray-900">
        <div class="flex flex-col items-center justify-center px-6 py-8 mx-auto md:h-screen lg:py-0">
            <a href="#" class="flex gap-2 items-center mb-6 text-2xl font-semibold text-gray-900 dark:text-white">
                <img src="https://blog.sblt.deali.cn:9000/Api/PicLib/Random/32/32" class="w-8 h-8" alt="Logo"/>
                <span class="self-center text-2xl font-semibold whitespace-nowrap dark:text-white">网站名称</span>
            </a>
            <div class="w-full bg-white rounded-lg shadow dark:border md:mt-0 sm:max-w-md xl:p-0 dark:bg-gray-800 dark:border-gray-700">
                <div class="p-6 space-y-4 md:space-y-6 sm:p-8">
                    <h1 class="text-xl font-bold leading-tight tracking-tight text-gray-900 md:text-2xl dark:text-white">
                        登录到你的账户
                    </h1>
                    <form class="space-y-4 md:space-y-6" method="post">
                        {% csrf_token %}
                        <div>
                            {{ form.username.label_tag }}
                            {{ form.username }}
                            {% if form.username.errors %}
                                <div class="mt-1 text-sm text-red-600">{{ form.username.errors }}</div>
                            {% endif %}
                        </div>
                        <div>
                            {{ form.password.label_tag }}
                            {{ form.password }}
                            {% if form.password.errors %}
                                <div class="mt-1 text-sm text-red-600">{{ form.password.errors }}</div>
                            {% endif %}
                        </div>
                        <div class="flex items-center justify-between">
                            <div class="flex items-start">
                                <div class="flex items-center h-5">
                                    <input id="remember" aria-describedby="remember" type="checkbox"
                                           class="w-4 h-4 border border-gray-300 rounded bg-gray-50 focus:ring-3 focus:ring-primary-300 dark:bg-gray-700 dark:border-gray-600 dark:focus:ring-primary-600 dark:ring-offset-gray-800">
                                </div>
                                <div class="ml-3 text-sm">
                                    <label for="remember" class="text-gray-500 dark:text-gray-300">保存登录状态</label>
                                </div>
                            </div>
                            <a href="#"
                               class="text-sm font-medium text-primary-600 hover:underline dark:text-primary-500">忘记密码？</a>
                        </div>
                        <button type="submit"
                                class="w-full text-white bg-primary-600 hover:bg-primary-700 focus:ring-4 focus:outline-none focus:ring-primary-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800">
                            登录
                        </button>
                        <p class="text-sm font-light text-gray-500 dark:text-gray-400">
                            还没有账号？
                            <a href="{% url 'account:sign-up' %}"
                               class="font-medium text-primary-600 hover:underline dark:text-primary-500">注册</a>
                        </p>
                    </form>
                </div>
            </div>
        </div>
    </section>
{% endblock %}